package etnorservice.etnor_service.controller;

import etnorservice.etnor_service.domain.MenuItemDomain;
import etnorservice.etnor_service.result.Result;
import etnorservice.etnor_service.service.MenuItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2025/03/24/13:09
 **/
@RestController
public class MenuController {

    @Autowired
    private MenuItemService menuItemService;

    @GetMapping("/menu/tree")
    public Result getMenuTree() {
        List<MenuItemDomain> menuTree = menuItemService.getMenuTree();
        Result result = new Result();
        result.setData(result);
        return result;
    }
}
